<?php

namespace Xx2025\Kingdee\Erp;

class BaseResponse implements ResponseInterface
{

    protected int $statusCode;
    protected bool $successful = false;
    protected string $errMsg = '';
    protected array $requestContents = [];
    protected array $responseContents = [];


    private static $_instace;


    public static function getBaseResponseInstance() :self
    {
        if(empty(self::$_instace)) {
            self::$_instace = new self();
        }
        return clone self::$_instace;
    }

    public function setStatusCode(int $statusCode)
    {
        $this->statusCode = $statusCode;
    }


    public function getStatusCode()
    {
        return $this->statusCode;
    }


    public function setSuccessful(bool $bool)
    {
        $this->successful = $bool;
    }

    public function isSuccessful() :bool
    {
        return $this->successful;
    }


    public function setErrMsg(string $msg)
    {
        $this->errMsg = $msg;
    }

    public function getErrMsg()
    {
        return $this->errMsg;
    }



    public function setRequestContents(array $requestContents)
    {
        $this->requestContents = $requestContents;
    }


    public function getRequestContents() :array
    {
        return $this->requestContents;
    }


    public function setResponseContents(array $responseContents)
    {
        $this->responseContents = $responseContents;
    }


    public function getResponseContents() :array
    {
        return $this->responseContents;
    }
}